Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 6 - Printing Resources / Printing Resources Reference
Resources Used Only in Printer Drivers


The Raster Package Controls ('ropt') Resource

The raster package controls ('ropt') resource, of type gxRasterPackOptionsType, is used to define how some forms of line feeding are performed on a raster device. This resource is optional.

Figure 6-25 shows the structure of a raster package controls resource.

Figure 6-25 The raster package controls resource

The raster package controls resource contains the following elements:

Table 6-33 shows the constants that you can use to specify the number types used in defining line feeds in raster package controls resources.
Table 6-33 Number types for specifying line feeds
ConstantValueExplanation
gxRasterNumNone0The number is not sent at all. Only the prefix and postfix strings are sent.
gxRasterNumDirect1The number is first padded to minimum width bytes by prepending 0's to it and is then sent as a sequence of hex bytes.
gxRasterNumToASCII2The number is converted to ASCII and then front-padded with the specified pad character to make it minimum width bytes long. The ASCII characters are then sent to the printer.

The ID of a raster package controls resource must be the constant gxRasterPackOptionsID. Listing 6-23 shows an example of a raster package controls resource for the ImageWriter II printer driver.

Listing 6-23 An example of a raster package controls resource

resource gxRasterPackOptionsType (gxRasterPackOptionsID, sysHeap,
                                                      purgeable)
{
   gxPrintingDriverBaseID,       /* ID of start page wstr res */
   gxPrintingDriverBaseID+10,    /* ID of form-feed wstr res */
            /* forward line-feed characteristics */
   98,                     /* max line-feed amount is 98 */
   gxRasterNumToASCII,     /* express line-feed as ASCII */
   2,                      /* minimum width is 2 */
   "0",                    /* pad with zeros */
   "\0X1BT",               /* <esc>T is set line-feed size */
   "\0X1Br\0X0A"  /* <esc>r<lf> is direction reverse, line feed */

                     /* reverse line-feed characteristics */
   98,               /* max line-feed amount is 98 */
   gxRasterNumToASCII,/* express line-feed as ASCII */
   2,                /* minimum width is 2 */
   "0",              /* pad with zeros */
   "\0X1BT",         /* <esc>T is set line-feed size */
   "\0X1Br\0X0A"  /* <esc>r<lf> is direction reverse, line feed */
};
resource 'wstr' (gxPrintingDriverBaseID, sysHeap, purgeable)
{
/*
   Start page string: unidirectional, 144 dpi ==
      ESC 5A 0700 ESC>ESCp
*/
   "\0X1BO" "\0X1B>" "\0X1Bp"};
resource 'wstr' (gxPrintingDriverBaseID+10, sysHeap,purgeable)
{
      /* End-page string: a control-L for IW's form feed */
   "\0X0C",
};
If you use the default implementation of the GXRasterLineFeed or GXRasterPackageBitmap messages, you must define a raster package controls ('ropt') resource. The GXRasterLineFeed and GXRasterPackageBitmap messages are described in the chapter "Printing Messages" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help